<?php
/**
 * The standard view renderer.
 */
class View_Renderer_Standard extends View_Renderer {
    /**
     * Render this object.
     * @param string $text
     * @return string
     */
    public function render($text) {
        parent::render($text);
        $this->processVars();
        return $this->text;
    }

    /**
     * Process any template variables.
     */
    protected function processVars() {
        $matches = array();
        preg_match_all('/\{\$(.+?)\}/', $this->text, $matches);
        foreach($matches[1] as $match) {
            $this->text = str_replace('{$' . $match . '}', $this->params[$match], $this->text);
        }
        //Debug::display($matches); exit;
    }
}
?>